<?php
if (isset($_POST['action'])){
	if ($_POST['action'] == 'get'){
		header('Content-Description: File Transfer');
		header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
		header('Content-Disposition: attachment; filename="'.basename('first1.xlsx').'"');
		header('Content-Transfer-Encoding: binary');
		header('Connection: Keep-Alive');
		header('Expires: 0');
		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
		header('Pragma: public');
		header('Content-Length: ' . filesize('first1.xlsx'));
		readfile('first1.xlsx');
	}
}
?>
<html>
<header>
<title>Excel file download</title>
</header>

<body>
<form id='download' name='download' action='download.php' method='post'>
<input type='hidden' name='action' value='get'/>
<input type='submit' value='Get excel file'/>
</form>
</body>
</html>